{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Control Flow in Python\n",
    "The code below demonstrates how the flow of program execution can be controlled using statements like `if`, `elif` and `else`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Y is between 5 and 10\n"
     ]
    }
   ],
   "source": [
    "Y = 7\n",
    "if 5 < Y < 10:\n",
    "    print(\"Y is between 5 and 10\")\n",
    "else: \n",
    "    print(\"Y is not between 5 and 10\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X is a small number\n"
     ]
    }
   ],
   "source": [
    "X = 4\n",
    "if X < 5:\n",
    "    print(\"X is a small number\")\n",
    "elif X < 20:\n",
    "    print(\"X is a medium sized number\")\n",
    "else:\n",
    "    print(\"X is a big number\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True is always True!\n"
     ]
    }
   ],
   "source": [
    "if True:\n",
    "    print(\"True is always True!\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "if False:\n",
    "    print(\"This will never be printed\")    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
